package com.avic.common.convertor;


import com.avic.controller.info.ShipResourceListInfo;
import com.avic.dal.model.ShipResource;

import java.util.ArrayList;
import java.util.List;

/**
 * 车辆资源对象转换器
 */
public class ShipResourceConvertor {


    public static List<ShipResourceListInfo> shipResourcesListVOToShipResourceListInfo(List<ShipResource> shipResources) {
        if (null != shipResources && shipResources.size() > 0) {
            List<ShipResourceListInfo> shipResourceListInfos = new ArrayList<>();
            shipResources.forEach(shipResource -> {
                ShipResourceListInfo shipResourceListInfo = new ShipResourceListInfo();
                shipResourceListInfo.setCreateTime(shipResource.getCreateTime());
                shipResourceListInfo.setId(shipResource.getId());
                shipResourceListInfo.setShipName(shipResource.getShipName());
                shipResourceListInfo.setShipNumber(shipResource.getShipNumber());
                shipResourceListInfos.add(shipResourceListInfo);
            });
            return shipResourceListInfos;
        }
        return new ArrayList<>();
    }


}
